import { Injectable } from '@angular/core'

import { ObservableStore } from '@shared/classes/ObservableStoreClass'
import { IDepositCollection, IDeposit } from '@shared/interfaces/deposit'

@Injectable()
export class DepositDataService {
  constructor() {}

  public depositData$: ObservableStore<IDepositCollection> = new ObservableStore({})
  public depositDetail$: ObservableStore<IDeposit> = new ObservableStore({} as IDeposit)

  setDepositData(data: IDepositCollection) {
    this.depositData$.setValue(data)
  }

  get depositData() {
    return this.depositData$.value
  }

  setDepositDetail(detail: IDeposit) {
    this.depositDetail$.setValue(detail)
  }

  get depositDetail() {
    return this.depositDetail$.value
  }
}
